<!-- pages/test/api-test.vue -->
<template>
  <view>
    <button @click="testLogin">测试登录</button>
    <button @click="testClassrooms">测试教室列表</button>
    <button @click="testSchedule">测试课程表</button>
  </view>
</template>

<script>
import { api } from '@/utils/request.js'

export default {
  methods: {
    async testLogin() {
      const res = await api.login({
        username: 'student01',
        password: '123456'
      })
      console.log('登录结果:', res)
    },
    
    async testClassrooms() {
      const res = await api.getClassrooms()
      console.log('教室列表:', res)
    },
    
    async testSchedule() {
      const res = await api.getCourseSchedule({ week: 1 })
      console.log('课程表:', res)
    }
  }
}
</script>